const request = require('./request')
const api = require('./api')

const getAmountLine = (cityCode) => {
    return request.apiGet(`${api.traffic.amountLine}?cityCode=${cityCode}`)
}

const getMileageLine = (cityCode) => {
    return request.apiGet(`${api.traffic.mileageLine}?cityCode=${cityCode}`)
}

const getUserFlowLine = (cityCode) => {
    return request.apiGet(`${api.traffic.userFlowLine}?cityCode=${cityCode}`)
}

const getBusWarnPie = (cityCode) => {
    return request.apiGet(`${api.traffic.busWarnPie}?cityCode=${cityCode}`)
}

const getYestodayData = (cityCode) => {
    return request.apiGet(`${api.traffic.yestodayData}?cityCode=${cityCode}`)
}

const getOperateData = (cityCode) => {
    return request.apiGet(`${api.traffic.operateData}?cityCode=${cityCode}`)
}

const getIntervalMileage = (cityCode) => {
    return request.apiGet(`${api.traffic.intervalMileage}?cityCode=${cityCode}`)
}
// 移动端大屏分割线------------------------------------------
const getMobilePayMount = (cityCode) => {
    return request.apiGet(`${api.mobile.mobilePayMount}?cityCode=${cityCode}`)
}

const getMobilePayCount = (cityCode) => {
    return request.apiGet(`${api.mobile.mobilePayCount}?cityCode=${cityCode}`)
}

const getMobileCardCount = (cityCode) => {
    return request.apiGet(`${api.mobile.mobileCardCount}?cityCode=${cityCode}`)
}

const getIntervalTotal = (cityCode) => {
    return request.apiGet(`${api.mobile.intervalTotal}?cityCode=${cityCode}`)
}

const getMapData = (cityCode) => {
    return request.apiGet(`${api.mobile.mapData}?cityCode=${cityCode}`)
}

const getDeviceData = (cityCode) => {
    return request.apiGet(`${api.mobile.deviceData}?cityCode=${cityCode}`)
}

const getSexData = (cityCode) => {
    return request.apiGet(`${api.mobile.sexData}?cityCode=${cityCode}`)
}

const getAreaData = (cityCode) => {
    return request.apiGet(`${api.mobile.areaData}?cityCode=${cityCode}`)
}

const getAgeData = (cityCode) => {
    return request.apiGet(`${api.mobile.ageData}?cityCode=${cityCode}`)
}

const getAveragePay = (cityCode) => {
    return request.apiGet(`${api.mobile.averagePay}?cityCode=${cityCode}`)
}

const getAveragePayPie = (cityCode) => {
    return request.apiGet(`${api.mobile.averagePayPie}?cityCode=${cityCode}`)
}

const getBusAveragePay = (cityCode) => {
    return request.apiGet(`${api.mobile.busAveragePay}?cityCode=${cityCode}`)
}

const getCityPay = () => {
    return request.apiGet(`${api.mobile.cityPay}`)
}

const getCityMonthPay = (cityCode) => {
    return request.apiGet(`${api.mobile.cityMonthPay}?cityCode=${cityCode}`)
}

module.exports = {
  trafficService: {
      getAmountLine,
      getMileageLine,
      getUserFlowLine,
      getBusWarnPie,
      getYestodayData,
      getOperateData,
      getIntervalMileage
  },
  mobileService: {
      getMobilePayMount,
      getMobilePayCount,
      getMobileCardCount,
      getIntervalTotal,
      getMapData,
      getDeviceData,
      getSexData,
      getAreaData,
      getAgeData,
      getAveragePay,
      getAveragePayPie,
      getBusAveragePay,
      getCityPay,
      getCityMonthPay
  }
}